const defaultState = {
  collspaed: false,
  theme: "dark",
};

export default function appReducer(state = defaultState, action) {
  switch (action.type) {
    case "toggleCollspaed":
      return {
        ...state,
        collspaed: !state.collspaed,
      };

    case "toggleTheme":
      return {
        ...state,
        theme: state.theme === "dark" ? "light" : "dark",
      };

    default:
      return state;
  }
}
